<!DOCTYPE html>
<html>

<head> 
    <meta charset="utf-8"> 
    <title>block query</title> 
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="/javascripts/jquery.js"></script>
    <style type="text/css">
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }

        input[type=text],
        select {
            width: 50%;
            padding: 6px 12px;
            margin: 8px 0;
            display: inline-block;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }

        input[type=submit] {
            width: 5%;
            background-color: #4CAF50;
            color: white;
            padding: 6px 12px;
            margin: 8px 0;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .topnav {
            overflow: hidden;
            background-color: #e9e9e9;
        }

        .topnav a {
            float: left;
            display: block;
            color: black;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
            font-size: 17px;
        }

        .topnav a:hover {
            background-color: #ddd;
            color: black;
        }

        .topnav a.active {
            background-color: #2196F3;
            color: white;
        }

        .topnav input[type=text] {
            float: right;
            padding: 6px;
            margin-top: 8px;
            margin-right: 16px;
            border: none;
            font-size: 17px;
        }

        @media screen and (max-width: 600px) {

            .topnav a,
            .topnav input[type=text] {
                float: none;
                display: block;
                text-align: left;
                width: 100%;
                margin: 0;
                padding: 14px;
            }

            .topnav input[type=text] {
                border: 1px solid #ccc;
            }
        }

        .myInput {


            background-image: url('https://static.runoob.com/images/mix/searchicon.png');
            /* 搜索按钮 */
            background-position: 10px 12px;
            /* 定位搜索按钮 */
            background-repeat: no-repeat;
            /* 不重复图片*/
            width: 500%;
            font-size: 14px;
            /* 加大字体 */
            padding: 12px 20px 12px 40px;
            border: 1px solid #ddd;
            margin-bottom: 2px;
        }

        .container {
            right: 20px;
            height: 20px;
            width: 200px;
            margin: 5px 200px 10px auto;
        }

        .parent {
            position: relative;
        }

        .search {
            background-image: url('https://static.runoob.com/images/mix/searchicon.png');
            /* 搜索按钮 */
            background-position: 300px 12px;
            /* 定位搜索按钮 */
            background-repeat: no-repeat;
            /* 不重复图片*/
            width: 350px;
            height: 40px;
            border-radius: 18px;
            outline: none;
            border: 1px solid #ccc;
            padding-left: 20px;
            position: absolute;
        }

        #myInput {
            background-image: url('https://static.runoob.com/images/mix/searchicon.png');
            /* 搜索按钮 */
            background-position: 15px 8px;
            /* 定位搜索按钮 */
            background-repeat: no-repeat;
            /* 不重复图片 */
            width: 100%;
            font-size: 16px;
            padding: 8px 20px 8px 40px;
            border: 1px solid #ddd;
            margin-bottom: 8px;
        }

        #myTable {
            border-collapse: collapse;
            width: 100%;
            border: 1px solid #ddd;
            font-size: 16px;
        }

        #myTable th,
        #myTable td {
            text-align: left;
            padding: 8px 20px 8px 18px;
        }

        #myTable tr {
            /* 表格添加边框 */
            border-bottom: 1px solid #ddd;
        }

        #myTable tr.header,
        #myTable tr:hover {
            /* 表头及鼠标移动过 tr 时添加背景 */
            background-color: #f1f1f1;
        }
    </style>
</head>

<body>
    <!-- <div class="topnav">
        <a class="active" href="#home">主页</a>
        <a href="#about">关于</a>
        <a href="#contact">联系我们</a>
        <input type="text" placeholder="搜索..">
    </div> -->
    <ul class="nav nav-pills">
        <li><a href="http://localhost:3000"><span style="font-size: 30px;">HOME</span></a></li>
        <li><a href="#"><span style="font-size: 5px;">HYPERLEDGER</a></li>
        <li><a href="#"><span style="font-size: 5px;">FABRIC</span></a></li>
        <li><a href="#"><span style="font-size: 5px;">NODE</span></a></li>
        <li><a href="#"><span style="font-size: 5px;">JS</span></a></li>
        <!-- <li> <input type="text" class="myInput" placeholder="搜索.."></li> -->
    </ul>

    <div style="margin-left:15px;margin-top:0px">
        <h4>当前区块的高度为：<span style="color:red;font-size: 32px;">
                <%= message.number %></span></h4>
    </div>

    <!-- <div class="container">
        <form action="" class="parent">
            <input type="text" class="search" placeholder="搜索">
        </form>
    </div> -->

    <!-- <input type="text" id="myInput" onkeyup="myFunction()" placeholder="搜索..."> -->
    <form action="/block" method="post">
        <input type="text" name="numberID" id="numberID" placeholder="Please enter the block height">
        <input type="submit" value="发送" id="blockquery">
    </form>



    <table id="myTable">
        <tr class="header">
            <th style="width:10%;">number</th>
            <th style="width:45%;">previous_hash</th>
            <th style="width:45%;">data_hash</th>
        </tr>
        <tr>
            <td>
                <%= message.low%>
            </td>
            <td>
                <%= message.previous_hash %>
            </td>
            <td>
                <%= message.data_hash %>
            </td>
        </tr>

    </table>

    <script>
        function myFunction() {
            // 声明变量
            var input, filter, table, tr, td, i;
            input = document.getElementById("myInput");
            filter = input.value.toUpperCase();
            table = document.getElementById("myTable");
            tr = table.getElementsByTagName("tr");

            // 循环表格每一行，查找匹配项
            for (i = 0; i < tr.length; i++) {
                td = tr[i].getElementsByTagName("td")[0];
                if (td) {
                    if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
                        tr[i].style.display = "";
                    } else {
                        tr[i].style.display = "none";
                    }
                }
            }
        }

    </script>


</body>

</html>